# 启动数据库
if [ "$(id -u)" -eq 0 ]; then
    su -c "/home/"$current_user"/ivsql/bin/pg_ctl -D /home/"$current_user"/ivsql/data start" -s /bin/bash "$current_user"
else
    /home/"$current_user"/ivsql/bin/pg_ctl -D /home/"$current_user"/ivsql/data start
fi
#修改数据库密码和用户名
echo "Configuring database..."
sudo -u "$current_user" /home/"$current_user"/ivsql/bin/psql -c "ALTER USER postgres WITH PASSWORD '$DB_PASSWORD';"
sudo -u "$current_user" /home/"$current_user"/ivsql/bin/psql -c "CREATE DATABASE $user_NAME;"
echo "Database configured successfully"
